package com.eupmt.lab3.domain;

import com.eupmt.lab3.domain.ibator.IbatorArticle;
import static com.eupmt.lab3.utils.Constants.*;

public class Article extends IbatorArticle implements Cloneable {

    public Article() {
        super();
        setIdarticle(UNDEFINED);
    }

    @Override
    public boolean equals(Object o) {
        return (o != null && (o instanceof Article) && (getIdarticle().equals(((Article) o).getIdarticle())));
    }

    @Override
    public int hashCode() {
        int hash = 5;
        return hash;
    }

    //Sobrecarrega del mètode toString()
    @Override
    public String toString() {
        String str = super.toString();
        str += "\n Article. \n";
        str += "id: " + this.getIdarticle() + "\n";
        str += "idPare: " + this.getIdpare() + "\n";
        str += "descripcio: " + this.getDescripcio() + "\n";
        str += "preuCost: " + this.getPreucost() + "\n";
        str += "preuVenda: " + this.getPreuvenda() + "\n";
        str += "categoria: " + this.getCategoria() + "\n";
        str += "duradaGarantia: " + this.getDuradagarantia() + "\n";
        return str;
    }
}
